Daniel Casadevall-Pino
W1177272
CMPS161 – Exploring PhysX
In this program I used the Wheel and Vehicle classes
that PhysX offers to implement a “driveable” version of the Chevrolet model
that we had in the first assignment.
The whole point of using PhysX is that, after
overcoming the learning curve, it is extremely easy to add more and more
interesting material to your project.
The car model that I used in concrete, makes use of
raycasting in order to calculate the vehicle’s reaction to terrain variations.
(it traces a ray from the origin of the wheel
to the ground).
Here we see the original Chevrolet model with its
normals defined, but not colored or in any environment:
The first big step for me was to identify each of the
car parts and give it color. All this is done when we read the file (code in
ReadCoor.h and cpp). After this process, we get the following result:
This is one part of my project, but the real part
comes with PhysX engine. Inserting this car into a physics engine was the real
challenge:
What we see in the image above is both the physical
interpretation (actor) and the actual opengl model that gives life to it, all
combined in the terrain that we are going to move around.
As we can see the physical model itself is not too
complicated. It’s enough for us to have a good feeling of collision with the
surface.
Besides the physical interaction with the rest of the
world that we will see in a video, I added a basic “skidmark” animation that
leaves a path behind our way, and wheel spinning
relative to our speed.
Note that we can throw boxes to the car, and observe
how they behave when the car is in motion and the box is on top of it.. etc.
Also try an jump to the ramp for some examples of
“crashing”.
As a final note I’d like to comment that I would have
loved to keep working on this project, as it is easier to add new stuff as you
progress (being the initial batch the worst part), but time limited my options
at the very end (although I did reach the plans I had, I wanted to play with
fluids maybe… etc).
Also, there is a lot of files which I have not
modified from PhysX engine (i.e the vehicle classes, etc..) most of my work I in
ReaCoor.h and ReadCoor.Cpp, along with the Final.h and Final.Cpp
files.